# -*- coding: utf-8 -*-

#-------------------------------------------------------------------------------
# Name：globals.py
# Description: 
# @Author: macy mei
# @Date:   2019/9/12
# @Last Modified by:   macy mei
# @Last Modified time: 2019/9/12 下午4:09
#-------------------------------------------------------------------------------
#处理全局变量
global _global_dict
_global_dict = {}

def set_value(name,value):
    _global_dict[name] = value

def get_value(name,def_value=None):
    try:
        return _global_dict[name]
    except KeyError:
        return def_value
# set_value("host","http://192.168.1.40")
#if __name__ == '__main__':
   # print()
    #a=globals()
    #a.set_value('host',"123")
    #print(a.get_value("host"))